<template>
<div id="placeholder" style="height: 100%; ">
   <el-button v-waves class="filter-item" type="primary" icon="el-icon-edit" @click="handleCreate">
         编辑文档
        </el-button>
</div>
</template>
<script>

export default {

  methods: {
     handleCreate() {
       window.docEditor = new DocsAPI.DocEditor("placeholder",
            {
                "document": {
                    "fileType": "docx",
                    "key":  Math.random().toString(19),
                    // Math.random().toString(19),
                    "title": "Example Document Title.docx",
                    "url": "http://192.168.1.118:9527/dev-api/organization/oauth/img/profile/avatar/2021/03/09/think.docx"
                },
                "documentType": "word",

                "editorConfig": {
                  // "customization":{
                  //   "autosave": false,
                  //   "forcesave": true
                  // },
                  "user": {
                    "name": "曾剑",
                    "id": "12345678901"
                  },
                  "lang": "zh-CN",
                    "callbackUrl": "http://192.168.1.118:8380/zj/ShuFile/docx/save?path=D:\\zengjian\\uploadPath\\avatar\\2021\\03\\09\\think.docx",
                },

                "height": "100%",
                "width": "100%"
            })
    },
  } }


    </script>
